home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
cprog.EXE
/
LEOCOM.ZIP
/
LEOCOM.DOC
next >
Wrap
Text File
|
1991-08-06
|
4KB
|
129 lines
LEOCOM 1.0
LEOCOM is a collection of routines used for asyncronous
communications on the IBM PC.
(C) Copyright 1991 by Leo Bicknell, All Rights Reserved.
This version is compiled for Turbo C++, small memory model.
This library is for test and evaluation purposes. It may
not be used in any Copyrighted programs of any kind, and many not
be used in any programs designed to be sold or liscened.
Registering this library will allow you to recompile for any
memory model, and make modifications to suit your specific needs.
Registration also allows you to use this library royality free in
any commercial or shareware program. Registered users will also
be elligable for low cost upgrades to the next version. To
register complete the form in REGISTER.DOC.
If you have any questions, comments, or suggestions I can be
reached on The Apollo III BBS (716) 896-6409 HST, or you can send
a letter US SNAIL to:
Leo Bicknell
46 Foxhunt Lane
East Amherst, NY 14051
Please allow at least 2 days for a responce on the BBS, and
2 weeks for a responce by SNAIL.
---
Now for the actual library. With this version I am not able
to fully expand on all of the public varables, that will be in
the next version with better documentation. This should be all
the information you need to get your program up and running
though.
---
void mclear(void);
Clears the incomming buffer.
---
int mclose(void);
Shutdown the communication package, a call to MOPEN must
have been prevously made, otherwise undefined results will occur.
---
THIS FUNCTION MUST BE CALLED BEFORE ALL OTHERS!!!!!
int mopen(int baud, int word, int parity, int stop, int BASE,
int VECTOR, int MASK);
baud - Baud rate divisor
word - Word length
parity - Parity setting
stop - Stop bits
BASE - Com port base address
VECTOR - Interrupt vector number
MASK - 8259 PIC comtroller mask
These are all provided to allow maximum flexability in the
package. Definitions for baud, word, parity, and stop can all be
found in LEOCOM.H. For standard com ports:
COM1 COM2
BASE 0x3f8 0x2f8
VECTOR 12 11
MASK IM4 IM3
Baud rate divisor can be calculated by the formula:
divisor = (int)(115200l / long_desired_baud_rate);
Word length can be DATA8, DATA7, DATA6, or DATA5,
representing 8, 7, 6, or 5 data bits, respectively.
Parity can be PNONE, PEVEN, or PODD, representing no,
even, and odd parity, respectively.
Stop can be STOP1 or STOP2 representing 1 or 2 stop bits,
respectively.
RETURNS: mopen will return TRUE or FALSE (defined in
LEOCOM.H). On false return a FATAL error has occured.
---
int mputs(char *s);
Send a string to the com port. Port must have been
prevously opened by MOPEN.
RETURNS: Number of charactors sent, or 0 if error.
---
int mputc(int c);
Send a charactor to the com port. Port must have been
prevously opened by MOPEN.
RETURNS: TRUE is sent, FALSE if send error.
---
int mgetc(void);
Get a charactor. Will automatically return scan code value
on DOORWAY mode keys. Port must have been prevously opened by
MOPEN.
RETURNS: ASCII or SCAN code.
---
void msdtr(int state);
Set DTR to LOW or HIGH (defined in LEOCOM.H). Port must
have been prevously opened by MOPEN.
---
void msrts(int state);
Set RTS to LOW or HIGH (defined in LEOCOM.H). Port must
have been prevously opened by MOPEN.
---
void msbreak(void);
Send a break over the com port. Port must have been
prevously opened by MOPEN.